<?php
namespace app\common\validate;

use think\Validate;

class Warehouse extends Validate
{
    protected $rule = [
        'area_id'    => 'require',
        'city_id'   => 'require',
        'province_id' => 'require',
        'name'   => 'require',
        'category_id'      =>  'require',
        'address'   => 'require',
        'linkman'   => 'require',
        'contact_number'   =>  '/^1[345789]\d{9}$/',
        'status'   => 'require',
    ];

    protected $message = [
        'area_id.require'  => '请选择区',
        'city_id.require'  => '请选择市',
        'province_id.require'  => '请选择省',
        'name.require'  => '请填写仓库名称',
        'category_id.require'  => '请选择仓库类型',
        'address.require'  => '请填写地址',
        'linkman.require'  => '请填写联系人',
        'contact_number'      => '请填写正确的手机号',
    ];

    protected $scene = [
        'add'      => ['area_id','city_id', 'province_id', 'name', 'category_id','address','linkman','contact_number'],
        'edit'     => ['area_id','city_id', 'province_id', 'name', 'category_id','address','linkman','contact_number'],
        'status'   => ['status'],
    ];




}